@extends('admin.layouts.index')
@section('contents')
 <div class="mws-panel grid_8">
    <div class="mws-panel-header">
        <span><i class="icon-table"></i> 用户列表</span>
    </div>
    <div class="mws-panel-body no-padding">
        <div id="DataTables_Table_1_wrapper" class="dataTables_wrapper" role="grid">

            <form action="/article" method='get'>
            
                    <div class="dataTables_length" id="DataTables_Table_1_length">
                        <label>
                            <select aria-controls="DataTables_Table_1" size="1"  name='num'>
                           
                                <option value="5" @if(!empty($request['num']) && $request['num']==5)selected @endif>5</option>
                                <option value="10" @if(!empty($request['num']) && $request['num']==10)selected @endif>10</option>
                                <option value="25" @if(!empty($request['num']) && $request['num']==25)selected @endif>25</option>
                                <option value="50" @if(!empty($request['num']) && $request['num']==50)selected @endif>50</option>
                                <option value="100" @if(!empty($request['num']) && $request['num']==100)selected @endif>100</option></select> 页
                        </label>
                  </div>

                  <div id="DataTables_Table_1_filter" class="dataTables_filter" >
                     <label ><input aria-controls="DataTables_Table_1" type="text" name='keywords'> </label>
                    <label>
                     <button type='submit' class='btn btn-primary'>查询</button>
                        
                    </label>
                  </div>
            </form>

          <table aria-describedby="DataTables_Table_1_info" id="DataTables_Table_1" class="mws-datatable-fn mws-table dataTable">
            <thead>
                <tr role="row"><th aria-label="Rendering engine: activate to sort column descending" aria-sort="ascending" style="width: 186px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_1" tabindex="0" role="columnheader" class="sorting_asc">ID</th>
                    <th aria-label="Browser: activate to sort column ascending" style="width: 251px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_1" tabindex="0" role="columnheader" class="sorting">类别</th>
                    <th aria-label="Platform(s): activate to sort column ascending" style="width: 234px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_1" tabindex="0" role="columnheader" class="sorting">标题</th>
                    <th aria-label="Platform(s): activate to sort column ascending" style="width: 234px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_1" tabindex="0" role="columnheader" class="sorting">描述</th>
                    <th aria-label="Engine version: activate to sort column ascending" style="width: 160px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_1" tabindex="0" role="columnheader" class="sorting">主图</th>
                    <th aria-label="CSS grade: activate to sort column ascending" style="width: 118px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_1" tabindex="0" role="columnheader" class="sorting">发表用户</th>
                    <th aria-label="CSS grade: activate to sort column ascending" style="width: 118px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_1" tabindex="0" role="columnheader" class="sorting">发表时间</th>
                    <th aria-label="CSS grade: activate to sort column ascending" style="width: 118px;" colspan="1" rowspan="1" aria-controls="DataTables_Table_1" tabindex="0" role="columnheader" class="sorting">操作</th>
                </tr>
            </thead>
            @foreach($data as $k=>$res)
               
                <tbody aria-relevant="all" aria-live="polite" role="alert">
                        @if($k%2==0)
                        <tr class="odd" align="center" >
                        @else
                        <tr class="even" align="center" >
                        @endif
                            <td class="  sorting_1">{{$res['id']}}</td>
                            <td class=" ">{{$res['name']}}</td>
                            <td class=" ">{{$res['title']}}</td>
                            <td class=" ">{{$res['des']}}</td>
                            <td class=" "><img src="{{$res['pic']}}" style='width:50px' alt=""></td>
                            <td class=" ">{{$res['uname']}}</td>
                            <td class=" ">{{date('Y/m/d H:i:s',$res['time'])}}</td>
                            <td class=" ">
                                <a href="/article/{{$res['id']}}/edit" class='icon-tools' style='font-size:15px;color:green;'></a>&nbsp;&nbsp;&nbsp;
                                <a href="/art_del/{{$res['id']}}" class='icon-trash' style='font-size:15px;color:red;'></a>
                            </td>
                        </tr>
                </tbody>
            @endforeach
        </table>
       
        <div id="pages" class="dataTables_paginate paging_full_numbers">

              {!!$data->render()!!} 

        </div>
      </div>
    </div>
</div>

@endsection